/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mlbs.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author mckd87
 */
@Entity
@Table(name = "devicetype")
@NamedQueries({@NamedQuery(name = "Devicetype.findByTypeId", query = "SELECT d FROM Devicetype d WHERE d.typeId = :typeId"), @NamedQuery(name = "Devicetype.findByVendor", query = "SELECT d FROM Devicetype d WHERE d.vendor = :vendor"), @NamedQuery(name = "Devicetype.findByNetwork", query = "SELECT d FROM Devicetype d WHERE d.network = :network"), @NamedQuery(name = "Devicetype.findByMemory", query = "SELECT d FROM Devicetype d WHERE d.memory = :memory"), @NamedQuery(name = "Devicetype.findByScreenSizeX", query = "SELECT d FROM Devicetype d WHERE d.screenSizeX = :screenSizeX"), @NamedQuery(name = "Devicetype.findByScreenSizeY", query = "SELECT d FROM Devicetype d WHERE d.screenSizeY = :screenSizeY"), @NamedQuery(name = "Devicetype.findByJavaEnabled", query = "SELECT d FROM Devicetype d WHERE d.javaEnabled = :javaEnabled")})
public class Devicetype implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "typeId", nullable = false)
    private Integer typeId;
    @Column(name = "vendor")
    private String vendor;
    @Column(name = "network")
    private String network;
    @Column(name = "memory")
    private Integer memory;
    @Column(name = "screenSizeX")
    private Integer screenSizeX;
    @Column(name = "screenSizeY")
    private Integer screenSizeY;
    @Column(name = "javaEnabled")
    private Character javaEnabled;
    @OneToMany(mappedBy = "typeId")
    private Collection<Device> deviceCollection;

    public Devicetype() {
    }

    public Devicetype(Integer typeId) {
        this.typeId = typeId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getVendor() {
        return vendor;
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public String getNetwork() {
        return network;
    }

    public void setNetwork(String network) {
        this.network = network;
    }

    public Integer getMemory() {
        return memory;
    }

    public void setMemory(Integer memory) {
        this.memory = memory;
    }

    public Integer getScreenSizeX() {
        return screenSizeX;
    }

    public void setScreenSizeX(Integer screenSizeX) {
        this.screenSizeX = screenSizeX;
    }

    public Integer getScreenSizeY() {
        return screenSizeY;
    }

    public void setScreenSizeY(Integer screenSizeY) {
        this.screenSizeY = screenSizeY;
    }

    public Character getJavaEnabled() {
        return javaEnabled;
    }

    public void setJavaEnabled(Character javaEnabled) {
        this.javaEnabled = javaEnabled;
    }

    public Collection<Device> getDeviceCollection() {
        return deviceCollection;
    }

    public void setDeviceCollection(Collection<Device> deviceCollection) {
        this.deviceCollection = deviceCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (typeId != null ? typeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Devicetype)) {
            return false;
        }
        Devicetype other = (Devicetype) object;
        if ((this.typeId == null && other.typeId != null) || (this.typeId != null && !this.typeId.equals(other.typeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mlbs.entity.Devicetype[typeId=" + typeId + "]";
    }

}
